package com.huilang.demo1;
/**
 * @version v1.0
 * @ClassName: AbstractBox
 * @Description: 抽象享元角色
 */
public abstract class AbstractBox {
    public abstract String getShape();

    public  void display(String color){
        System.out.println("图像"+getShape()+"的颜色"+color);
    };
}
/**
 * @version v1.0
 * @ClassName: IBox
 * @Description: I图形类(具体享元角色)
 */
 class Ibox extends AbstractBox {
     @Override
     public String getShape() {
         return "I";
     }
 }

class Lbox extends AbstractBox {
    @Override
    public String getShape() {
        return "L";
    }
}

class Obox extends AbstractBox {
    @Override
    public String getShape() {
        return "O";
    }
}